<?php

if ( !session_id() ) session_start();

$_SESSION['flash_checked'] = TRUE;

if ( $_GET['j'] ) $_SESSION['j'] = TRUE;
if ( $_COOKIE['c'] ) $_SESSION['c'] = TRUE;

if ( intval($_GET['flash_version']) > 0 ) $_SESSION['flash_version'] = intval($_GET['flash_version']);

if ( !$_SESSION['redirect_url'] ) $_SESSION['redirect_url'] = '/';

if ( !$_SESSION['c'] ) {
	if ( strpos($_SESSION['redirect_url'], '?') !== false  ) {
		$_SESSION['redirect_url'] .= '&' . session_name() . '=' . session_id();
	} else {
		$_SESSION['redirect_url'] .= '?' . session_name() . '=' . session_id();
	}
}

header('Location: ' . $_SESSION['redirect_url']);
exit;